package com.glory.brepda.activity.technicalservice;

import android.os.Build;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.CheckBox;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.glory.brepda.R;
import com.glory.brepda.activity.mfg.MultiEqpTrackOutActivity;
import com.glory.brepda.adapter.EqpKeepListAdapter;
import com.glory.brepda.base.BaseActivity;
import com.glory.brepda.callback.CustomDialogEntityCallBack;
import com.glory.brepda.entity.EDCListBean;
import com.glory.brepda.entity.EqpKeepBean;
import com.glory.brepda.entity.EqpKeepInfoBean;
import com.glory.brepda.entity.EqpKeepListBean;
import com.glory.brepda.entity.ScrapEntity;
import com.glory.brepda.entity.response.BaseResponseBean;
import com.glory.brepda.entity.stateChangeEntity;
import com.glory.brepda.utils.NetUtils;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import com.lzy.okgo.model.Response;
import com.pda.platform.ui.ui_pdaplatform.callback.FreeUI_DialogEntityCallBack;
import com.pda.platform.ui.ui_pdaplatform.callback.FreeUI_EntityCallBack;
import com.pda.platform.ui.ui_pdaplatform.datepicker.CustomDatePicker;
import com.pda.platform.ui.ui_pdaplatform.dialog.FreeUI_GeneralPop;
import com.pda.platform.ui.ui_pdaplatform.entity.FreeUI_AddViewEntity;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_DateUtils;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_DialogUtils;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_LogUtils;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_PopUtils;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_StringUtils;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_ToastUtils;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_Utils;
import com.pda.platform.ui.ui_pdaplatform.view.FreeUI_ClearEditText;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;

import androidx.annotation.RequiresApi;
import androidx.core.widget.NestedScrollView;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.DividerItemDecoration;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import butterknife.BindView;
import butterknife.OnClick;

public class Eqp_EqpKeepActivity extends BaseActivity implements BaseQuickAdapter.OnItemClickListener {


    boolean isBegin;
    @BindView(R.id.etEqpWork)
    FreeUI_ClearEditText etEqpWork;
    @BindView(R.id.tvEqpWorkDetails)
    TextView tvEqpWorkDetails;
    @BindView(R.id.tvSearch)
    TextView tvSearch;
    @BindView(R.id.rvEqpKeepList)
    RecyclerView rvEqpKeepList;
    @BindView(R.id.llMain)
    LinearLayout llMain;
    @BindView(R.id.tvBeginTime)
    TextView tvBeginTime;
    @BindView(R.id.ivBeginTimeArrow)
    ImageView ivBeginTimeArrow;
    @BindView(R.id.flBeginTimeList)
    FrameLayout flBeginTimeList;
    @BindView(R.id.tvEndTime)
    TextView tvEndTime;
    @BindView(R.id.ivEndTimeArrow)
    ImageView ivEndTimeArrow;
    @BindView(R.id.flEndTimeList)
    FrameLayout flEndTimeList;
    @BindView(R.id.list_tv1)
    TextView listTv1;
    @BindView(R.id.list_tv2)
    TextView listTv2;
    @BindView(R.id.list_tv3)
    TextView listTv3;
    @BindView(R.id.list_tv4)
    TextView listTv4;
    @BindView(R.id.nsScroll)
    NestedScrollView nsScroll;
    @BindView(R.id.cbCreate)
    CheckBox cbCreate;
    @BindView(R.id.cbComplete)
    CheckBox cbComplete;
    @BindView(R.id.cbSave)
    CheckBox cbSave;
    @BindView(R.id.flEqpType)
    FrameLayout flEqpType;
    @BindView(R.id.tvEqpType)
    FreeUI_ClearEditText tvEqpType;
    @BindView(R.id.ivEqpType)
    ImageView ivEqpType;
    @BindView(R.id.tvEqpTypeQuery)
    TextView tvEqpTypeQuery;
    @BindView(R.id.flMaintenanceContent)
    FrameLayout flMaintenanceContent;
    @BindView(R.id.tvMaintenanceContent)
    FreeUI_ClearEditText tvMaintenanceContent;
    @BindView(R.id.ivMaintenanceContent)
    ImageView ivMaintenanceContent;
    @BindView(R.id.tvMaintenanceQuery)
    TextView tvMaintenanceQuery;
    private CustomDatePicker mDatePicker;
    private String beginDate;
    private String endDate;
    private EqpKeepListAdapter eqpKeepListAdapter;
    private List<EqpKeepListBean> xPmsScheduleResults;
    private FreeUI_GeneralPop mEqpTypePop;
    private FreeUI_GeneralPop mMaintenanceContentPop;
    private List<String> mEqpTypeList = new ArrayList<>();
    private List<String> mQueryEqpTypeList = new ArrayList<>();
    private List<String> mMaintenanceContentList = new ArrayList<>();
    private List<String> mQueryMaintenanceContentList = new ArrayList<>();


    @Override
    protected int getLayoutResId() {
        return R.layout.activity_eqp_keep;
    }

    @Override
    protected void initView() {
        listTv1.setText("保养名称");
        listTv2.setText("保养描述");
        listTv3.setText("状态");
        listTv4.setText("计划时间");
        listTv1.setVisibility(View.VISIBLE);
        listTv2.setVisibility(View.VISIBLE);
        listTv3.setVisibility(View.VISIBLE);
        listTv4.setVisibility(View.VISIBLE);
        initDatePicker();
        initEdit(etEqpWork, s -> {
        });
        beginDate = FreeApi_DateUtils.getAfterStringDate(new Date(System.currentTimeMillis()), "yyyy-MM-dd", -3);
        tvBeginTime.setText(beginDate);
        endDate = FreeApi_DateUtils.getAfterStringDate(new Date(System.currentTimeMillis()), "yyyy-MM-dd", 7);
        tvEndTime.setText(endDate);

        rvEqpKeepList.setLayoutManager(new LinearLayoutManager(Eqp_EqpKeepActivity.this));
        rvEqpKeepList.setItemAnimator(new DefaultItemAnimator());
        rvEqpKeepList.addItemDecoration(new DividerItemDecoration(Eqp_EqpKeepActivity.this, 1));
        eqpKeepListAdapter = new EqpKeepListAdapter(null);
        eqpKeepListAdapter.openLoadAnimation(BaseQuickAdapter.ALPHAIN);
        eqpKeepListAdapter.isFirstOnly(true);
        rvEqpKeepList.setAdapter(eqpKeepListAdapter);

        eqpKeepListAdapter.setOnItemClickListener(this);
    }

    @Override
    protected void initData() {

        queryEqpType();
        queryMaintenanceContent();

        tvEqpType.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

            }

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {

            }

            @Override
            public void afterTextChanged(Editable s) {
                // 在文本改变后调用
                if (s.length() == 0) {
                    mQueryEqpTypeList = mEqpTypeList;
                }

            }
        });

        tvMaintenanceContent.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

            }

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {

            }

            @Override
            public void afterTextChanged(Editable s) {
                // 在文本改变后调用
                if (s.length() == 0) {
                    mQueryMaintenanceContentList = mMaintenanceContentList;
                }

            }
        });
    }

    private void initDatePicker() {
        long beginTimestamp = FreeApi_DateUtils.str2Long("1992-03-20", false);
        long endTimestamp = FreeApi_DateUtils.str2Long("2222-02-22", false);

        // 通过时间戳初始化日期，毫秒级别
        mDatePicker = new CustomDatePicker(this, timestamp -> {
            if (isBegin) {
                beginDate = FreeApi_DateUtils.long2Str(timestamp, false);
                tvBeginTime.setText(beginDate);
            } else {
                endDate = FreeApi_DateUtils.long2Str(timestamp, false);
                tvEndTime.setText(endDate);
            }

        }, beginTimestamp, endTimestamp);
        // 不允许点击屏幕或物理返回键关闭
        mDatePicker.setCancelable(true);
        // 不显示时和分
        mDatePicker.setCanShowPreciseTime(false);
        // 不允许循环滚动
        mDatePicker.setScrollLoop(false);
        // 不允许滚动动画
        mDatePicker.setCanShowAnim(false);
    }

    @Override
    protected FreeUI_AddViewEntity getBaseEntity() {
        freeUI_titleView.setTitle("设备保养");
        freeUI_titleView.setRightListener("隐藏", v -> {

//            initPermission("Refresh", this, new ActionControlListener() {
//                @Override
//                public void onControlChangeListener() {
//                    nsScroll.setVisibility(nsScroll.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE);
//                }
//            });

        });
        return new FreeUI_AddViewEntity("header", llMain);
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (etEqpWork.getText().toString().trim().length() == 0) {
            return;
        }
        search();
    }

    @OnClick({R.id.flBeginTimeList, R.id.flEndTimeList, R.id.tvSearch, R.id.ivEqpType, R.id.ivMaintenanceContent, R.id.tvEqpTypeQuery, R.id.tvMaintenanceQuery})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.flBeginTimeList:
                isBegin = true;
                mDatePicker.show(System.currentTimeMillis());
                break;
            case R.id.flEndTimeList:
                isBegin = false;
                mDatePicker.show(System.currentTimeMillis());
                break;
            case R.id.tvSearch:

//                if (etEqpWork.getText().toString().trim().length() == 0) {
//                    showToast("设备号不能为空", false);
//                    return;
//                }


                if (!FreeApi_StringUtils.isEmpty(beginDate) && !FreeApi_StringUtils.isEmpty(endDate)) {
                    int i = FreeApi_DateUtils.compare_date(endDate, beginDate, "yyyy-MM-dd");
                    if (i != 1) {
                        showToast("结束日期不能大于开始日期", false);
                        tvBeginTime.setText("请选择开始日期");
                        tvEndTime.setText("请选择结束日期");
                        beginDate = "";
                        endDate = "";
                        return;
                    }
                    search();
                } else {
                    showToast("开始时间和结束时间不能为空", false);
                }

                break;
            case R.id.ivEqpType:
                mEqpTypePop = FreeApi_PopUtils.getNormalPop(getApplicationContext(), flEqpType.getWidth(), mQueryEqpTypeList, ivEqpType, (codeS, i) -> {
                    tvEqpType.setText(codeS);
                });
                FreeApi_PopUtils.setArrowShow(ivEqpType);
                mEqpTypePop.showAsDropDown(flEqpType, 0, 0);
                break;
            case R.id.ivMaintenanceContent:
                mMaintenanceContentPop = FreeApi_PopUtils.getNormalPop(getApplicationContext(), flMaintenanceContent.getWidth(), mQueryMaintenanceContentList, ivMaintenanceContent, (codeS, i) -> {
                    tvMaintenanceContent.setText(codeS);
                });
                FreeApi_PopUtils.setArrowShow(ivMaintenanceContent);
                mMaintenanceContentPop.showAsDropDown(flMaintenanceContent, 0, 0);
                break;
            case R.id.tvEqpTypeQuery:
                mQueryEqpTypeList = eqpTypeCode(getText(tvEqpType));
                if (mQueryEqpTypeList.isEmpty()) {
                    showToast("没有对应项目", false);
                    return;
                } else {
                    tvEqpType.setText(mQueryEqpTypeList.get(0));
                }
                break;
            case R.id.tvMaintenanceQuery:
                mQueryMaintenanceContentList = maintenanceCode(getText(tvMaintenanceContent));
                if (mQueryMaintenanceContentList.isEmpty()) {
                    showToast("没有对应项目", false);
                    return;
                } else {
                    tvMaintenanceContent.setText(mQueryMaintenanceContentList.get(0));
                }
                break;
        }
    }

    private List<String> eqpTypeCode(String code) {
        List<String> targetList = new ArrayList<>();
        if (!code.equals("")) {
            for (int i = 0; i < mEqpTypeList.size(); i++) {
                if (mEqpTypeList.get(i).contains(code)) {
                    targetList.add(mEqpTypeList.get(i));
                }
            }
            return targetList;
        } else {
            return mEqpTypeList;
        }

    }


    private List<String> maintenanceCode(String code) {
        List<String> targetList = new ArrayList<>();
        if (!code.equals("")) {
            for (int i = 0; i < mMaintenanceContentList.size(); i++) {
                if (mMaintenanceContentList.get(i).contains(code)) {
                    targetList.add(mMaintenanceContentList.get(i));
                }
            }
            return targetList;
        } else {
            return mMaintenanceContentList;
        }

    }


    private void search() {

        FreeUI_EntityCallBack<BaseResponseBean<EqpKeepBean>> callBack = new FreeUI_DialogEntityCallBack<BaseResponseBean<EqpKeepBean>>
                (new TypeToken<BaseResponseBean<EqpKeepBean>>() {
                }.getType(), getSupportFragmentManager(), this) {

            @Override
            public void onSuccess(Response<BaseResponseBean<EqpKeepBean>> response) {
                super.onSuccess(response);
                if (response.body().isSuccess(getApplicationContext(), true, getSupportFragmentManager())) {
                    EqpKeepBean eqpKeepBean = response.body().getResponse().getBody();
                    tvEqpWorkDetails.setText(eqpKeepBean.getEqpDesc());
                    xPmsScheduleResults = eqpKeepBean.getXPmsScheduleResults();
                    List<EqpKeepListBean> checkData = new ArrayList<>();
                    checkData.clear();
                    if (xPmsScheduleResults.size() > 0) {
                        if (!cbComplete.isChecked() & !cbCreate.isChecked() & !cbSave.isChecked()) {
                            nsScroll.setVisibility(View.GONE);
                            eqpKeepListAdapter.setNewData(xPmsScheduleResults);
                        } else {
                            for (EqpKeepListBean data : xPmsScheduleResults) {
                                String status = data.getStatus();
                                if (cbCreate.isChecked()) {
                                    if (status.equals("CREATE") | status.equals("WARNING")
                                            | status.equals("CANSTART") | status.equals("START")) {
                                        checkData.add(data);
                                    }
                                }

                                if (cbComplete.isChecked()) {
                                    if (status.equals("COMPLETE")) {
                                        checkData.add(data);
                                    }
                                }

                                if (cbSave.isChecked()) {
                                    if (status.equals("FORM")) {
                                        checkData.add(data);
                                    }
                                }
                            }

                            if (checkData.size() <= 0) {
                                showConfirmDialog("当前状态下无点检计划");
                                eqpKeepListAdapter.setNewData(null);
                            } else {
                                nsScroll.setVisibility(View.GONE);
                                eqpKeepListAdapter.setNewData(checkData);
                            }
                        }
                    } else {
                        showConfirmDialog("暂无保养计划");
                    }
                }
            }

            @Override
            public void onError(Response<BaseResponseBean<EqpKeepBean>> response) {
                super.onError(response);
                loadError(response.getException(), "PMSSCHEDULE");
            }
        };

        JsonObject map = new JsonObject();
        map.addProperty("actionType", "query");
        map.addProperty("eqpId", etEqpWork.getText().toString().trim());
        map.addProperty("startTime", beginDate);
        map.addProperty("endTime", endDate);
        map.addProperty("equipmentType", tvEqpType.getText().toString());
        map.addProperty("pmsSheetName", tvMaintenanceContent.getText().toString());
        NetUtils.requestPostNet("IF.PMSSCHEDULE", "PMSSCHEDULE", Eqp_EqpKeepActivity.this, map, callBack);

    }


    @Override
    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
        EqpKeepListBean item = xPmsScheduleResults.get(position);
        switch (item.getStatus()) {
            case "CREATE"://创建
            case "WARNING"://警告
            case "CANSTART"://可以开始
                FreeApi_DialogUtils.getConfirmAndCancelDialog(this, "是否开始设备保养?", () -> {

                    FreeUI_EntityCallBack<BaseResponseBean<?>> callBack = new FreeUI_DialogEntityCallBack<BaseResponseBean<?>>
                            (new TypeToken<BaseResponseBean<?>>() {
                            }.getType(), getSupportFragmentManager(), this) {

                        @Override
                        public void onSuccess(Response<BaseResponseBean<?>> response) {
                            super.onSuccess(response);
                            if (response.body().isSuccess(getApplicationContext(), false, getSupportFragmentManager())) {
                                item.setStatus("START");
                                adapter.notifyItemChanged(position);
                            }
                        }

                        @Override
                        public void onError(Response<BaseResponseBean<?>> response) {
                            super.onError(response);
                            loadError(response.getException(), "PMSSCHEDULE");
                        }
                    };
                    JsonObject map = new JsonObject();
                    map.addProperty("actionType", "startSchedule");
                    map.addProperty("scheduleRrn", item.getScheduleRrn());
                    NetUtils.requestPostNet("IF.PMSSCHEDULE", "PMSSCHEDULE", Eqp_EqpKeepActivity.this, map, callBack);

                }, () -> {
                }).show(getSupportFragmentManager(), "EQPKEEP");
                break;
            case "START"://已开始
            case "FORM"://已临时保存
                Bundle bundle = new Bundle();
                bundle.putString("scheduleRrn", item.getScheduleRrn());
                bundle.putString("eqpWork", etEqpWork.getText().toString().trim());
                bundle.putString("equipmentDesc", item.getEquipmentDesc());
                FreeApi_Utils.skipWithExtraIntent("header", bundle, Eqp_EqpKeepActivity.this, Eqp_EqpKeepDetailsActivity.class);
                break;
            case "COMPLETE"://已完成
                showToast("当前保养项已完成", false);
                break;
            case "TIMEOUT"://超时
                //showToast("当前保养项已超时", false);
                FreeApi_DialogUtils.getConfirmAndCancelDialog(this, "该设备保养已超时，是否开始设备保养?", () -> {

                    FreeUI_EntityCallBack<BaseResponseBean<?>> callBack = new FreeUI_DialogEntityCallBack<BaseResponseBean<?>>
                            (new TypeToken<BaseResponseBean<?>>() {
                            }.getType(), getSupportFragmentManager(), this) {

                        @Override
                        public void onSuccess(Response<BaseResponseBean<?>> response) {
                            super.onSuccess(response);
                            if (response.body().isSuccess(getApplicationContext(), false, getSupportFragmentManager())) {
                                item.setStatus("START");
                                adapter.notifyItemChanged(position);
                            }
                        }

                        @Override
                        public void onError(Response<BaseResponseBean<?>> response) {
                            super.onError(response);
                            loadError(response.getException(), "PMSSCHEDULE");
                        }
                    };
                    JsonObject map = new JsonObject();
                    map.addProperty("actionType", "startSchedule");
                    map.addProperty("scheduleRrn", item.getScheduleRrn());
                    NetUtils.requestPostNet("IF.PMSSCHEDULE", "PMSSCHEDULE", Eqp_EqpKeepActivity.this, map, callBack);

                }, () -> {
                }).show(getSupportFragmentManager(), "EQPKEEP");
                break;
            case "IDLE"://超时
                //showToast("当前保养项已超时", false);
                FreeApi_DialogUtils.getConfirmAndCancelDialog(this, "该设备长期待料，是否开始设备保养?", () -> {

                    FreeUI_EntityCallBack<BaseResponseBean<?>> callBack = new FreeUI_DialogEntityCallBack<BaseResponseBean<?>>
                            (new TypeToken<BaseResponseBean<?>>() {
                            }.getType(), getSupportFragmentManager(), this) {

                        @Override
                        public void onSuccess(Response<BaseResponseBean<?>> response) {
                            super.onSuccess(response);
                            if (response.body().isSuccess(getApplicationContext(), false, getSupportFragmentManager())) {
                                item.setStatus("START");
                                adapter.notifyItemChanged(position);
                            }
                        }

                        @Override
                        public void onError(Response<BaseResponseBean<?>> response) {
                            super.onError(response);
                            loadError(response.getException(), "PMSSCHEDULE");
                        }
                    };
                    JsonObject map = new JsonObject();
                    map.addProperty("actionType", "startSchedule");
                    map.addProperty("scheduleRrn", item.getScheduleRrn());
                    NetUtils.requestPostNet("IF.PMSSCHEDULE", "PMSSCHEDULE", Eqp_EqpKeepActivity.this, map, callBack);

                }, () -> {
                }).show(getSupportFragmentManager(), "EQPKEEP");
                break;
            default:
                break;
        }

    }


    private void queryMaintenanceContent() {

        FreeUI_EntityCallBack<BaseResponseBean<EqpKeepInfoBean>> callBack = new FreeUI_DialogEntityCallBack<BaseResponseBean<EqpKeepInfoBean>>
                (new TypeToken<BaseResponseBean<EqpKeepInfoBean>>() {
                }.getType(), getSupportFragmentManager(), this) {

            @RequiresApi(api = Build.VERSION_CODES.N)
            @Override
            public void onSuccess(Response<BaseResponseBean<EqpKeepInfoBean>> response) {
                super.onSuccess(response);
                if (response.body().isSuccess(getApplicationContext(), false, getSupportFragmentManager())) {

                    response.body().getResponse().getBody().getxPmsPeriods().forEach(new Consumer<EqpKeepInfoBean.XPmsPeriodsDTO>() {
                        @Override
                        public void accept(EqpKeepInfoBean.XPmsPeriodsDTO xPmsPeriodsDTO) {
                            mMaintenanceContentList.add(xPmsPeriodsDTO.getNAME());
                        }
                    });

                }
            }

            @Override
            public void onError(Response<BaseResponseBean<EqpKeepInfoBean>> response) {
                super.onError(response);
                loadError(response.getException(), "PMSSCHEDULE");
            }
        };
        JsonObject map = new JsonObject();
        map.addProperty("actionType", "queryPmsPeriod");
        NetUtils.requestPostNet("IF.PMSSCHEDULE", "Common", Eqp_EqpKeepActivity.this, map, callBack);

    }


    private void queryEqpType() {

        FreeUI_EntityCallBack<BaseResponseBean<EqpKeepInfoBean>> callBack = new FreeUI_DialogEntityCallBack<BaseResponseBean<EqpKeepInfoBean>>
                (new TypeToken<BaseResponseBean<EqpKeepInfoBean>>() {
                }.getType(), getSupportFragmentManager(), this) {

            @RequiresApi(api = Build.VERSION_CODES.N)
            @Override
            public void onSuccess(Response<BaseResponseBean<EqpKeepInfoBean>> response) {
                super.onSuccess(response);
                if (response.body().isSuccess(getApplicationContext(), false, getSupportFragmentManager())) {

                    response.body().getResponse().getBody().getADREFLIST().forEach(new Consumer<EqpKeepInfoBean.ADREFLISTDTO>() {
                        @Override
                        public void accept(EqpKeepInfoBean.ADREFLISTDTO adreflistdto) {
                            mEqpTypeList.add(adreflistdto.getTEXT());
                        }
                    });

                }
            }

            @Override
            public void onError(Response<BaseResponseBean<EqpKeepInfoBean>> response) {
                super.onError(response);
                loadError(response.getException(), "ADREFLISTQUERY");
            }
        };
        JsonObject map = new JsonObject();
        map.addProperty("REFERENCENAME", "EquipmentType");
        map.addProperty("REFERENCETYPE", "USER");
        NetUtils.requestPostNet("IF.ADREFLISTQUERY", "Common", Eqp_EqpKeepActivity.this, map, callBack);

    }

}
